import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Defines a Jefe
 * @author Hugo Armando Rodríguez Flores
 * @version May 26th 2013
 */
public abstract class Jefe extends Enemigo
{
    private int lifePercentage; //All bosses have a resistance
    
    /**
     * Constructs a new Jefe.
     */
    public Jefe()
    {
        lifePercentage=100;
    }
    
    /**
     * @return the current life percentage of this boss.
     */
    public int getLifePercentage()
    {
        return lifePercentage;
    }
    
    /**
     * Sets a new life percentage for this boss.
     * @param damage is the damage has been inflicted on the current boss
     */
    public void setLifePercentage(int damage)
    {
        lifePercentage-=damage;
    }
    
    /**
     * Inflicts damage over Thomas
     * @param damage is the damage this boss will cause to Thomas
     */
    public void inflictDamage(int damage)
    {
        Actor thomas=getOneIntersectingObject(Thomas.class);
        if (thomas!=null)
            ((Thomas)thomas).lowLifePercentageFromOutside(damage);
    }
}
